<%@page isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<div>
 <tiles:insertDefinition name="public.menus.blogs"/>
 <table cellspacing="0" cellpadding="0" class="table_list">
  <tbody>  
	<c:forEach items="${courses}" var="course">		
		<tr><td>
			<div class="listingTitle">${course.title}</div>
			<div>
			<div style="float:left; padding-right:10px">
				<img src="/img/course_available.jpg"/>
			</div>
			<p class="listingDescription">${course.description}</p>
			<p>See full course details: <a href="/serve.do?key=${course.fileKey}">as an attachment.</a></p>
			</div>
		</td></tr>		   	
   	</c:forEach>	   	
</tbody></table>
</div>

<div class="public_paging">
      <ul>
      <c:forEach begin="1" end="${pages}" step="1" var="num">
      	<c:choose>
      		<c:when test="${num == page}">
      			<li><a class="current" href="/courses/available.do?page=${num}">${num}</a></li>
      		</c:when>
      		<c:otherwise>
      			<li><a href="/courses/available.do?page=${num}">${num}</a></li>
      		</c:otherwise>
      	</c:choose>
      </c:forEach>
      <c:choose>
      	<c:when test="${page lt pages}">
        	<li><a class="next" href="/courses/available.do?page=${page + 1}">NEXT</a></li>
      	</c:when>
      	<c:otherwise>
      	</c:otherwise>
      </c:choose>
      </ul>
</div>